<template>
  <div class="main-header">
      <p>{{title}}</p>
      <p @click="hanleToOut">退出</p>
  </div>
</template>

<script>
export default {
    name: 'sonComponentsHeader',
    props: {
        title: {
            type: String,
            default: '分类管理'
        }
    },
    methods: {
        hanleToOut(){
            localStorage.removeItem('id')
            this.$router.push('/login')
        }
    }
}
</script>

<style lang="scss" scoped>
    .main-header{
        height: 50px;
        display: flex;
        justify-content: space-between;
        box-shadow: 0 0 20px 2px rgb(221, 221, 221);
        p{
            cursor: pointer;
            line-height: 50px;
            font-size: 14px;
            color: #545c64;
            &:first-child{
                 padding-left: 50px;
            }
            &:last-child{
                 padding-right: 50px;
            }
        }
    }
</style>